//package entities;
//
//import java.io.Console;
//import java.util.ArrayList;
//import java.util.List;
//
//import org.junit.Assert;
//import org.junit.Test;
//
//import custom_types.Afm;
//import custom_types.Date;
//import custom_types.EmailAddress;
//import custom_types.Rating;
//
//public class BrokerTest {
//	@Test
//    public void addNullForAdvertisement() {
//        Broker broker = new Broker();                    
//        broker.addAdvertisement(null);
//        Assert.assertEquals(0,broker.getAdvertisements().size());
//    }
//	
//
//    @Test
//    public void addAdvertisement() {
//    	Broker broker = new Broker();
//    	Advertisement ad = new Advertisement();
//    	broker.addAdvertisement(ad);
//    	Assert.assertEquals(1, broker.getAdvertisements().size());
//    }
//    
//    @Test
//    public void removeNullForAdvertisement() {
//    	Broker broker = new Broker();
//    	Advertisement ad = new Advertisement();
//    	broker.addAdvertisement(ad);
//    	broker.removeAdvertisement(null);
//    	Assert.assertEquals(1, broker.getAdvertisements().size());
//    }
//    
//    @Test
//    public void removeAdvertisement() {
//    	Broker broker = new Broker();
//    	Advertisement ad = new Advertisement();
//    	broker.addAdvertisement(ad);
//    	broker.removeAdvertisement(ad);
//    	Assert.assertEquals(0, broker.getAdvertisements().size());
//    }
//    
//    @Test
//    public void constructorTest(){
//    	String username = "testuser";
//    	String password = "testpass";
//    	EmailAddress email = new EmailAddress("test@test.com");
//    	String name = "testname";
//    	String surname = "testsurname";
//    	int day = 11;
//    	int month = 11;
//    	int year = 2013;
//    	Date date = new Date(day,month,year);
//    	Afm afm = new Afm(1324324);
//    	List<Advertisement> ads = new ArrayList<Advertisement>();
//    	Advertisement ad = new Advertisement();
//    	ads.add(ad);
//    	Broker broker = new Broker(username,password,email,name,surname,date,afm,ads);
//    	Assert.assertEquals(username,broker.getUsername());
//    	Assert.assertEquals(password,broker.getPassword());
//    	Assert.assertEquals(email.getEmail(),broker.getEmail().getEmail());
//    	Assert.assertEquals(name,broker.getName());
//    	Assert.assertEquals(surname,broker.getSurname());
//    	Assert.assertEquals(date.getDay(),broker.getRegistrationDate().getDay());
//    	Assert.assertEquals(date.getMonth(),broker.getRegistrationDate().getMonth());
//    	Assert.assertEquals(date.getYear(),broker.getRegistrationDate().getYear());
//    	Assert.assertEquals(afm.getAfm(),broker.getAfm());
//    	Assert.assertEquals(1, broker.getAdvertisements().size());
//    }
//
//	@Test
//    public void setRatings(){
//    	Broker broker = new Broker();
//    	broker.addRating(5.0);
//    	broker.addRating(7.0);
//    	broker.addRating(9.0);
//    	Assert.assertEquals(7.0,broker.getRating(),0.001);
//    }
//	
//	@Test
//	public void changeAfmToWrong(){
//		Broker broker = new Broker();
//		int afm_right = 11111111;
//		int afm_wrong = 1324;
//		broker.setAfm(afm_right);
//		Assert.assertEquals(11111111, broker.getAfm());
//		broker.setAfm(afm_wrong);
//		Assert.assertEquals(11111111, broker.getAfm());
//	}
//
//    
//    
//}
